<template>
  <div class="data-head">
    <div class="data-head-left">
      <div class="data-head-line"></div>
      <div style="margin: 0 5px"><slot name="icon"></slot></div>
      <div>
        <slot name="title"></slot>
      </div>
      <div>
        <slot name="number"></slot>
      </div>
    </div>
    <div v-show="showDetail" class="data-head-view">
     <slot name="view"></slot>
    </div>
  </div>
</template>
<script>
export default {
  name: "DataHead",
  props: {
    showDetail: {
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {};
  },
  methods: {
  },
};
</script>

<style scoped lang="scss">
.data-head {
  height: 40px;
  line-height: 40px;
  border-bottom: 2px solid #4f46e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.data-head-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.data-head-line {
  width: 4px;
  height: 20px;
  border-radius: 6px;
  background-color: #4f46e5;
}
.data-head .svg-icon {
  fill: #4f46e5;
  margin-right: 5px;
}
.data-head p {
  font-size: 1em;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-weight: 600;
}
.warn-number {
  display: inline;
  padding: 4px 8px;
  color: #fff;
  background-color: #ef4444;
  border-radius: 10px;
  margin-left: 8px;
  font-size: 11px;
}
.data-head-view {
  height: 30px;
  line-height: 30px;
  padding: 0 5px;
  border-radius: 5px;
  // background: rgba(59, 130, 246, 0.1);
  // border: 1px solid rgba(59, 130, 246, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgba(59, 130, 246, 0.8);
  font-size: 14px;
  cursor: pointer; 
}
</style>
